package com.dsg.entity.oil;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Time;
import java.util.Date;

/**
 * <p>
 * 入油数据明细
 * </p>
 *
 * @author system
 * @since 2020-07-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("dsg_oil_data_detail")
@ApiModel(value = "DsgOilDataDetail对象", description = "入油数据明细")
public class DsgOilDataDetail implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主鍵")
    @TableId("OID")
    private String oid;

    @ApiModelProperty(value = "入油数据汇总ID")
    @TableField("PID")
    private String pid;

    @ApiModelProperty(value = "咭號")
    @TableField("CARD_NO")
    private String cardNo;

    @ApiModelProperty(value = "車牌號")
    @TableField("CAR_NUMBER")
    private String carNumber;

    /**
     * 产品编号
     */
    @TableField(value = "PRODUCT_NO")
    @ApiModelProperty(value = "产品编号", name = "productNo")
    private String productNo;

    @ApiModelProperty(value = "油站ID")
    @TableField("STATION_ID")
    private String stationId;

    @ApiModelProperty(value = "交易日期")
    @TableField("TRANS_DATE")
    private Date transDate;

    @ApiModelProperty(value = "交易時間")
    @TableField("TRANS_TIME")
    private Time transTime;

    @ApiModelProperty(value = "油的升數")
    @TableField("OIL_LITERS")
    private BigDecimal oilLiters;

    @ApiModelProperty(value = "油的單價")
    @TableField("OIL_PRICE")
    private BigDecimal oilPrice;

    @ApiModelProperty(value = "油的總價")
    @TableField("OIL_VALUE")
    private BigDecimal oilValue;

    @ApiModelProperty(value = "重算后油的总价")
    @TableField(value = "OIL_RE_VALUE")
    private BigDecimal oilReValue;

    @ApiModelProperty(value = "現金抵扣金額")
    @TableField(value = "CASH_DEDU_VALUE")
    private BigDecimal cashDeduValue;

    @ApiModelProperty(value = "折扣金额")
    @TableField(value = "DISCOUNT_VALUE")
    private BigDecimal discountValue;

    @ApiModelProperty(value = "行政费")
    @TableField(value = "ADMIN_VALUE")
    private BigDecimal adminValue;

    @ApiModelProperty(value = "優惠")
    @TableField("DISCOUNT")
    private BigDecimal discount;

    @ApiModelProperty(value = "是否接受")
    @TableField("IS_ACCEPT")
    private Integer isAccept;

    @ApiModelProperty(value = "是否成功")
    @TableField("IS_SUCCESS")
    private Integer isSuccess;

    @ApiModelProperty(value = "是否记入交易账目")
    @TableField("IS_ACCOUNT")
    private Integer isAccount;

    @ApiModelProperty(value = "存疑情況")
    @TableField(updateStrategy = FieldStrategy.IGNORED, value = "IS_DOUBT")
    private String isDoubt;

    @ApiModelProperty(value = "備註")
    @TableField("REMARKS")
    private String remarks;

    /**
     * 企業編號
     */
    @TableField(value = "ENT_CODE")
    @ApiModelProperty(value = "企業編號", name = "entCode")
    private String entCode;

    /**
     * 创建人
     */
    @TableField(value = "CREATER")
    @ApiModelProperty(value = "创建人", name = "creater")
    private String creater;

    /**
     * 创建时间
     */
    @TableField(value = "CREATE_TIME")
    @ApiModelProperty(value = "创建时间", name = "createTime")
    private Date createTime;

    /**
     * 更新人
     */
    @TableField(value = "UPDATER")
    @ApiModelProperty(value = "更新人", name = "updater")
    private String updater;

    /**
     * 更新时间
     */
    @TableField(value = "UPDATE_TIME")
    @ApiModelProperty(value = "更新时间", name = "updateTime")
    private Date updateTime;

    @ApiModelProperty(value = "正負值查詢 1:正值 2:負值 空:全部")
    @TableField(exist = false)
    private String plusMinusLiters;

    @ApiModelProperty(value = "油公司")
    @TableField(exist = false)
    private String oilCom;

    @ApiModelProperty(value = "支付銀行卡號/帳戶編號")
    @TableField(exist = false)
    private String payAccountNo;

    @ApiModelProperty(value = "支付銀行名稱/帳戶名稱")
    @TableField(exist = false)
    private String payAccountName;

    @ApiModelProperty(value = "付款人")
    @TableField(exist = false)
    private String payer;

    @ApiModelProperty(value = "收款帳戶編號")
    @TableField(exist = false)
    private String accountNo;

    @ApiModelProperty(value = "收款帳戶名稱")
    @TableField(exist = false)
    private String accountName;

    @ApiModelProperty(value = "客戶編號")
    @TableField(exist = false)
    private String cusNo;

//    @ApiModelProperty(value = "客戶資料OID")
//    @TableField(exist = false)
//    private String ownsId;

    @ApiModelProperty(value = "系統時間")
    @TableField(exist = false)
    private String date;

    @ApiModelProperty(value = "幾年內數據")
    @TableField(exist = false)
    private int year;

    @ApiModelProperty(value = "升數集合以,號隔開")
    @TableField(exist = false)
    private String oilLitersList;

    @ApiModelProperty(value = "銀行標識")
    @TableField(exist = false)
    private String bankId;

    @ApiModelProperty(value = "收款方式")
    @TableField(exist = false)
    private String payMethod;

    @ApiModelProperty(value = "付款方式")
    @TableField(exist = false)
    private String payMode;

    @ApiModelProperty(value = "交易账目主键")
    @TableField(exist = false)
    private String tradeId;

    @ApiModelProperty(value = "咭表OID")
    @TableField(exist = false)
    private String cardOid;

    /************************枚舉**********************/
    public enum AppStatus {
        //year為上油數據檢查判斷重復數據的年限3為3年
        temporary(0), accept(1), refuse(2),
        success(1), failure(2), year(3),
        notCredit(0), alreadyCredit(1);
        Integer code;

        AppStatus(int code) {
            this.code = code;
        }

        public Integer getCode() {
            return code;
        }
    }

    public enum AppStatusChar {
        A("A"), B("B"), C("C");
        String code;

        AppStatusChar(String code) {
            this.code = code;
        }

        public String getCode() {
            return code;
        }
    }
}
